package com.zhudi.develop_demo_as.ui.fragment.order;

import android.os.Bundle;

import com.zhudi.develop_demo_as.BaseListViewFragment;
import com.zhudi.develop_demo_as.JsonObjectParser;
import com.zhudi.develop_demo_as.adapter.BaseListViewAdapter;
import com.zhudi.develop_demo_as.adapter.OrderTypeAdapter;
import com.zhudi.develop_demo_as.entity.Photo;
import com.zhudi.develop_demo_as.entity.parser.ModelTestParser;

public class OrderTypeFragment extends BaseListViewFragment {
    protected static final String TYPE = "project_search_";
    private String key;


    public static OrderTypeFragment newInstance(String searchKey) {
        OrderTypeFragment fragment = new OrderTypeFragment();
        Bundle args = new Bundle();
        args.putString(TYPE, searchKey);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            key = getArguments().getString(TYPE);
        }
    }



    @Override
    protected String getItemURL(int page) {
        if (key.equals("0")){
            return "http://wwww.baidu.com";
        } else if (key.equals("1")){
            return  "http://www.qq.com";
        } else {
            return null;
        }

    }

    @Override
    protected BaseListViewAdapter getAdapter() {
        return new OrderTypeAdapter(getActivity());
    }


    @Override
    protected JsonObjectParser getGsonType() {
        return new ModelTestParser();
    }

    @Override
    protected Object getModel() {
        return new Photo();
    }
}
